import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import AboutView from '../views/AboutView.vue'

Vue.use(VueRouter)

const routes = [{
        path: "/",
        redirect: '/a1'
    },
    {
        path: '/a1',
        component: HomeView
    },
    {
        path: '/about',
        component: AboutView,
        redirect: "/about/movie",
        children: [{
            path: 'movie',
            component: () =>
                import ('../views/about-movie.vue')
        }, {
            path: 'info',
            component: () =>
                import ('../views/about-info.vue'),
            children: [{
                path: 'pingjia',
                component: () =>
                    import ('../views/info-pingjia.vue')
            }, {
                path: 'pingfen',
                component: () =>
                    import ('../views/info-pingfen.vue')
            }]
        }, {
            path: 'us',
            component: () =>
                import ('../views/about-us.vue')
        }]
    }, {
        path: '/a2',
        component: () =>
            import ('../views/Other.vue')
    },
]

const router = new VueRouter({
    routes
})

export default router